import axios from '@/api'



/******************* 成员营业员 *******************/
export function becomeStaff(params) {
    return axios.request({
        url: '/laundry/users/become/staff',
        method: 'post',
        data: params
    });
}

/******************* 列表 *******************/
export function list(params) {
    return axios.request({
        url: '/laundry/users/findByPage',
        method: 'post',
        data: params
    });
}

/******************* 列表查询会员 *******************/
export function staffList(params) {
    return axios.request({
        url: '/laundry/users/findStaffList',
        method: 'post',
        data: params
    });
}

/******************* findById *******************/
export function findById(id) {
    return axios.request({
        url: '/laundry/users/findById/' + id,
        method: 'get'
    });
}

/******************* findByPhone *******************/
export function findByPhone(phone) {
    return axios.request({
        url: '/laundry/users/findByPhone/' + phone,
        method: 'get'
    });
}

/******************* checkByPhone *******************/
export function checkByPhone(phone) {
    return axios.request({
        url: '/laundry/users/checkByPhone/' + phone,
        method: 'get'
    });
}

/******************* 添加 *******************/
export function add(phone) {
    return axios.request({
        url: '/laundry/users/save/'+phone,
        method: 'post'
    });
}

/******************* 编辑 *******************/
export function upgrade(params) {
    return axios.request({
        url: '/laundry/users/upgradeUser?id='+params.id+'&memberId='+params.memberId,
        method: 'put'

    });
}

/******************* 绑定卡（激活卡） *******************/
export function cardActivate(params) {
    return axios.request({
        url: '/laundry/users/cardActivate',
        method: 'post',
        data: params

    });
}

/******************* 删除 *******************/
export function del(id) {
    return axios.request({
        url: '/laundry/users/removeById/'+id,
        method: 'delete'
    });
}
